package com.hup.sidebar.model;

import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

import lombok.ToString;

@ToString
public class AppInfoItem {

    public final String name;
    public final String packageName;
    public final ApplicationInfo applicationInfo;

    public AppInfoItem(PackageInfo info, PackageManager packageManager) {
        name = packageManager.getApplicationLabel(info.applicationInfo).toString();
        packageName = info.packageName;
        applicationInfo = info.applicationInfo;
    }

    public AppInfoItem(ApplicationInfo info, PackageManager packageManager) {
        name = packageManager.getApplicationLabel(info).toString();
        packageName = info.packageName;
        applicationInfo = info;
    }

}